package com.xin.di.uav.common.enums;

/**
 * @Description 用户优惠券状态
 * @Author LTQ
 * @Date 2022/4/16 10:43 PM
 */
public enum UserCouponStatusEnum {
    /**
     * 状态 0: 待领取 1:未使用 2:已使用 3:已过期
     */
    NOT_RECEIVE("待领取",0),NOT_USED("未使用",1),USED("已使用",2),EXPIRED("已过期",3),INVALID("已失效",4);
    private String desc;
    private Integer value;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    UserCouponStatusEnum(String desc, Integer vaule){
        this.desc = desc;this.value = vaule;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getValue(Integer code) {
        for (UserCouponStatusEnum ele : values()) {
            if (ele.getValue().equals(code)) {return ele.getDesc();};
        }
        return null;
    }
}
